{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from enum import Enum\n",
    "\n",
    "class Color(Enum):\n",
    "    RED = 1\n",
    "    GREEN = 2\n",
    "    BLUE = 3\n",
    "\n",
    "# 使用枚举\n",
    "my_color = Color.RED\n",
    "print(my_color)  # 输出: Color.RED\n",
    "print(my_color.value)  # 输出: 1\n",
    "\n",
    "# 遍历枚举成员\n",
    "for color in Color:\n",
    "    print(color.name, color.value)"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
